begintownscript;
variables;
short choice,i;

body;
beginstate init_state;
i = 0;
while(char_ok(i) == 0){
	i = i + 1;
}
spawn_creature(7);
set_character_pose(6,14);
set_char_dialogue_pic(6,304,0);
//set_name(6,"Bandit");
break;

beginstate exit_state;
break;

beginstate start_state;
break;

beginstate 10;
block_entry(1);
message_dialog("From the sound of it, the battle to the north was growing increasingly heated. When there's fighting going on in these woods it can't be good-- lets just say the chances that Lord Gromwell's men hunted down some bandits is pretty slim.","I wasn't sure whom the fight was between, but no doubt one of the sides needed some help-- and fast. Bandits are quick and ruthless, I'd never leave someone in their hands.");
break;

beginstate 11;
if(get_flag(1,0) > 0)
	end();
force_view_center(25,20);
force_instant_terrain_redraw();
pause(3);

force_view_center(25,19);
force_instant_terrain_redraw();
pause(3);

force_view_center(24,18);
force_instant_terrain_redraw();
pause(3);

force_view_center(24,17);
force_instant_terrain_redraw();
pause(3);

force_view_center(23,16);
force_instant_terrain_redraw();
pause(3);

force_view_center(23,15);
force_instant_terrain_redraw();
pause(3);

force_view_center(23,14);
force_instant_terrain_redraw();
pause(3);

reset_dialog();
add_dialog_str(0,"A merchant's cart, heavily laden with goods, had been toppled over in the center of the road. Merchants are always prime targets for banditry-- this fellow must have been a fool to ride through these woods without an escort.",0);
add_dialog_str(1,"The merchant in question was sprawled in the dust. An armed man stood over him. He looked dangerous-- more so than the halfwits that usually turn to banditry-- but at least there was only one of him.",0);
add_dialog_str(2,"He had his sword unsheathed and held a throwing dagger in his off hand. He was looking to the east, but suddenly the merchant at his feet groaned, attracting his attention.",0);
add_dialog_str(3,"The poor dandy had been a fool to get himself in this position, but I couldn't just leave him there. I drew my blade and rushed the bandit.",0);
add_dialog_choice(0,"OK");
choice = run_dialog(1);

set_flag(1,0,1);
force_view_center(char_loc_x(i),char_loc_y(i));
force_instant_terrain_redraw();
erase_char(7);
activate_hidden_group(1);
set_name(8,"Bandit");
play_sound(18);
break;

beginstate 12;
	if(get_flag(1,2) > 0)
		end();
	if(get_flag(1,1) == 0){
		message_dialog("This bandit fought like a pro-- but I never even thought about running. That's no brag-- I knew he would have stuck me in the back with one of those throwing daggers if I'd tried.","");
		block_entry(1);
	}
	else{
		message_dialog("I wouldn't leave the merchant just lying there-- I DID just save him after all.","");
		block_entry(1);
	}
break;

beginstate 13;
if(get_flag(1,0) > 0){
	block_entry(1);
	if(get_flag(1,1) == 0)
		message_dialog("This bandit fought like a pro-- but I never even thought about running. That's no brag-- I knew he would have stuck me in the back with one of those throwing daggers if I'd tried.","");
	else{
		if(get_flag(1,2) == 0)
			message_dialog("I wouldn't leave the merchant just lying there-- I DID just save him after all.","");
		else
			message_dialog("The nearest inn was the Leaping Basilisk-- unfortunately it was to the west and out of my way, but I couldn't carry the chap all the way back to the Chapel and I could hardly just leave him there.","Oh the inconveniences of decency.");
	}
}
break;

beginstate 14;
erase_char(8);
text_bubble_on_char(i,"!");
force_instant_terrain_redraw();
pause(3);
message_dialog("He was a skilled fighter, no doubt about that, but I had the advantage of surprise. I parried one of his blows and sent him reeling, then raised my blade to deliver the deathblow.","Suddenly though-- and you'll hardly believe this-- he disappeared! Poof! Right into thin air. One second he's looking up at my sword ready to meet his maker, next he's vanished.");
message_dialog("I stood there dumbfounded for a few seconds, then slowly lowered my sword. I don't know what the hell he was-- certainly no normal bandit can fight like that, and no normal man can disappear-- but at least he was gone and the merchant was safe.","");
set_flag(1,1,1);
break;

beginstate 15;
move_to_new_town(2,27,26);
break;

beginstate 100;
block_entry(1);
break;